package org.zy;

/**
 * @author Zhang Yu
 * @description: TODO
 * @date 2024/5/9 9:16
 */
public class ThreadDemo {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("Thread:" + Thread.currentThread().getName());
        });
        t1.start();

        t1.join();
        System.out.println("Thread:" + Thread.currentThread().getName());
    }
}
